package com.cbj.netty;



import com.cbj.netty.proxy.MyProxy;
import com.cbj.netty.server.Cat;
import com.cbj.netty.server.Dog;
import com.cbj.netty.server.Server;

import java.io.IOException;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author Godc
 * @description
 */
// TODO:1.换协议 2.zk注册中心 3.注解或者xml注册到spring 4.javassist提高反射效率
public class ClientStart {
    public static void main(String[] args) {
        Thread[] threads = new Thread[20];
        for (int i = 0; i < 20; i++) {
            threads[i] = new Thread(()->{
                Cat cat = MyProxy.proxyGet(Cat.class);
                String eat = cat.eat("balabala");
                System.out.println(eat);
            });
        }
        // 模拟20个线程调用
        for (int i = 0; i < 20; i++) {
            threads[i].start();
        }
        try {
            System.in.read();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

